package com.joint.web.action.mp;

import com.joint.base.util.security.NetWork;
import com.joint.web.action.BaseAdminAction;
import org.apache.struts2.convention.annotation.ParentPackage;

/**
 * 后台Action类 - 微信首页
 * ============================================================================
 * 版权所有 2014 min_xu。
 * ----------------------------------------------------------------------------
 * 
 * @author min_xu
 * 
 * @version 1.1 2014-3-31
 */

@ParentPackage("mp")
public class Web365Action extends BaseAdminAction {
	private static final long serialVersionUID = -5383463207248344961L;

    String f;
    String pIndex;

    public void setF(String f) {
        this.f = f;
    }

    public void setPIndex(String pIndex) {
        this.pIndex = pIndex;
    }

    public String getF() {
        return f;
    }

    public String getPIndex() {
        return pIndex;
    }

    public String execute(){
        System.out.println("f:"+f);
        System.out.println("pIndex:"+pIndex);
        String fileUrl = "http://officeweb365.com/n/pdf/GetNextPage/?f="+f+"&pIndex="+pIndex;
        String urlData =  NetWork.getUrlData(fileUrl);
        System.out.println("fileUrl:"+fileUrl);
      //  urlData =  urlData.replaceAll("GetPageIndex()", "alert('do');GetPageIndex()");
        urlData =  urlData.replaceAll("\\.\\.\\/", "http://officeweb365.com/n/");
      //  urlData =  urlData.replaceAll("GetNextPage", "Web365Action.action");
        return ajaxHtml(urlData);
    }

}
